package com.cloud.iotdb;

/**
 * @program: mqtt
 * @description: iotdb实体
 * @author: Cloud
 * @create: 2021/10/15 15:51:52
 */
import com.google.gson.Gson;
import java.util.List;

public class IotdbVO {
    private String device;
    private long timestamp = System.currentTimeMillis();
    private List<String> measurements;
    private List<Object> values;

    public String getDevice() {
        return device;
    }

    public void setDevice(String device) {
        this.device = device;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public List<String> getMeasurements() {
        return measurements;
    }

    public void setMeasurements(List<String> measurements) {
        this.measurements = measurements;
    }

    public List<Object> getValues() {
        return values;
    }

    public void setValues(List<Object> values) {
        this.values = values;
    }

    public String toJson(){
        Gson g = new Gson();
        String jsonData = g.toJson(this);
        return jsonData;
    }


    @Override
    public String toString() {
        return "IotdbVO{" +
                "device='" + device + '\'' +
                ", timestamp=" + timestamp +
                ", measurements=" + measurements +
                ", values=" + values +
                '}';
    }
}
